<?php
/**
 * Created by Zhy
 * User: Zhy
 * Date: 2023/12/14
 * Time: 10:38
 */

namespace app\api\model;

class Area extends Base
{
    /**
     * 查询地区列表
     * @param $where
     * @param $field
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    static function selectArea($where = [], $field = '*'){
        return self::where($where)->field($field)->select()->toArray();
    }

    /**
     * 查找单条
     * @param $where
     * @param $field
     * @return array|bool|\PDOStatement|string|\think\Model|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    static function findArea($where = [], $field = '*'){
        return self::where($where)->field($field)->find();
    }
}